Closed
Bug 1743042
Opened 4 years ago
Closed 29 days ago
Document::InitCSP checks whether NodePrincipal is an ExpandedPrincipal (which is never true)
Categories
(Core :: DOM: Security, task, P3)
Core
DOM: Security
Tracking
()
RESOLVED
FIXED
140 Branch
Tracking | Status | |
---|---|---|
firefox140 | --- | fixed |
People
(Reporter: robwu, Assigned: tschuster)
References
(Blocks 1 open bug)
Details
(Whiteboard: [domsecurity-backlog1])
Attachments
(1 file)
I came across the logic below in Document::InitCSP
, which checks whether a node principal is an ExpandedPrincipal
(and attaches a CSP to it when it is). A node principal can never be an expanded principal, so the branch is never reached. We should remove it (which would also simplify part of the work on bug 1548468).
nsresult Document::InitCSP(nsIChannel* aChannel) {
....
nsCOMPtr<nsIPrincipal> principal = NodePrincipal();
...
// Bug 1548468: Move CSP off ExpandedPrincipal
// Currently the LoadInfo holds the source of truth for every resource load
// because LoadInfo::GetCSP() queries the CSP from an ExpandedPrincipal
// (and not from the Client) if the load was triggered by an extension.
auto* basePrin = BasePrincipal::Cast(principal);
if (basePrin->Is<ExpandedPrincipal>()) {
basePrin->As<ExpandedPrincipal>()->SetCsp(mCSP);
}
Comment 1•4 years ago
|
||
When working on Bug 1548468 we should also address this bug, putting in the backlog for now.
Priority: -- → P3
Whiteboard: [domsecurity-backlog1]
Assignee | ||
Comment 2•1 month ago
|
||
Updated•1 month ago
|
Assignee: nobody → tschuster
Status: NEW → ASSIGNED
Pushed by tschuster@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/43839ffc2ae0
Document::InitCSP checks whether NodePrincipal is an ExpandedPrincipal (which is never true). r=smaug
Status: ASSIGNED → RESOLVED
Closed: 29 days ago
status-firefox140:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 140 Branch
Updated•7 days ago
|
QA Whiteboard: [qa-triage-done-c141/b140]
You need to log in
before you can comment on or make changes to this bug.
Description
•